package org.luu.medicare.controller.reimburseController;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.luu.medicare.common.Result;
import org.luu.medicare.entity.PageBean;
import org.luu.medicare.entity.TPersonnelVisitsInfo;
import org.luu.medicare.service.PersonnelVisitService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/cancel")
@Slf4j
@RequiredArgsConstructor(onConstructor_ = {@Autowired})
public class CancelReimController {
    private final PersonnelVisitService personnelVisitService;

    @DeleteMapping("/{id}")
    public Result<String> deleteById(@PathVariable Integer id){
        return personnelVisitService.deleteById(id);
    }

    @GetMapping
    public Result<PageBean<TPersonnelVisitsInfo>> page(@RequestParam(defaultValue = "1") int page,
                                                         @RequestParam(defaultValue = "10") int pageSize,
                                                         String name,
                                                         String id){
        return personnelVisitService.page(page, pageSize, name, id);
    }
}
